package com.jhs.kjs.dto;

import com.jhs.kjs.dto.util.abstractDTO;

public class MemberPagingDTO extends abstractDTO{
	private final int unit = 10;
	private int custom_unit = -1;
	
	private int start = 0;
	private int end = 0;
	private int nowSeq = 0;
	private int page = 1;
	private int totalPage = 0;
	private int seq = 0;
	private String userName;
	private String userId;
	public int getStart() {
		if (getPage() > 0 && start == 0) {
			return 1 + getUnit() * (getPage() - 1);
		}
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getEnd() {
		if (getPage() > 0 && end == 0) {
			return getUnit() * getPage();
		}
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}

	public int getNowSeq() {
//		ss;
		return nowSeq;
	}

	public void setNowSeq(int nowSeq) {
		this.nowSeq = nowSeq;
		int i = 0;

		for (; getUnit() * i < nowSeq; i++) {
			page = i + 1;
		}
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getSeq() {
		return seq;
	}

	public void setSeq(int seq) {
		this.seq = seq;
	}


	public int getCustom_unit() {		
		return custom_unit;
	}

	public void setCustom_unit(int custom_unit) {
		this.custom_unit = custom_unit;
	}

	private int getUnit() {
		if(custom_unit > 0) {
			return custom_unit;
		}
		return unit;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	


}
